/**************************************************************/
/*  This file is licensed from, and is a trade secret of:     */
/*                                                            */
/*    Mercury Computer Systems, Incorporated                  */
/*    199 Riverneck Road                                      */
/*    Chelmsford, Massachusetts 01824-2820                    */
/*    United States of America                                */
/*    Telephone + 1 978 256-1300                              */
/*                                                            */
/*  Refer to your Software License Agreement for provisions   */
/*  on use, duplication, or disclosure.                       */
/*  US. Government users and prime contractors are also       */
/*  governed by the following Data Rights Notice:             */
/*  Use, duplication or disclosure by the US. Government is   */
/*  subject to the provisions set forth in FAR 52.227-14 for  */
/*  restricted rights or other agency data rights provisions  */
/*  on commercial software and documentation, as applicable.  */
/*                                                            */
/*  This file: (a) was developed at private expense, and no   */
/*  part was developed with government funds, (b) is a        */
/*  trade secret of Mercury Computer Systems, Inc. for the    */
/*  purposes of the Freedom of Information Act, (c) is        */
/*  "commercial computer software" subject to limited         */
/*  utilization as provided in the above noted Software       */
/*  License Agreement and (d) is in all respects data         */
/*  belonging exclusively to Mercury Computer Systems, Inc..  */
/*                                                            */
/**************************************************************/

/******************************************************************/
/* Copyright ¨ 1999-2003, Mercury Computer Systems, Inc.,         */
/* Chelmsford MA.,and all third party embedded software sources.  */
/* All rights reserved under the Copyright laws of US. and        */
/* international treaties.                                        */
/*                                                                */
/* Patent Pending                                                 */
/******************************************************************/


//$COPYRIGHT_END



// Wrapper to proxy the SCA standard class types until we can hook 
// up with the real thing
#ifndef SCA_TYPES_H
#define SCA_TYPES_H

#include <string>
#include <vector>

using namespace std;

#include "SCA_Exception.h"

namespace SCA_Desc {

  class SCA_XML_PARSE_API ID{
  public: 
    string name;
    ID(const char *input_name): name(input_name){}
    ID() {};

  inline bool operator ==(const ID &id) 
    { return name == id.name; }
  inline bool operator !=(const ID &id) const
    { return name != id.name; }
  };


};


// Common function needed for repository classes
template<class T>
void vector_ptrs_cleanup(T &inp_vec)
{
  unsigned int ii;
  unsigned int num_elements = inp_vec.size();

  for(ii=0; ii < num_elements; ii++)
    delete inp_vec[ii];
}

#if 0 // This template should work???, but generates an internal compiler eror
template<class T>
void vector_ptrs_copy(const vector<T *> &inp_vec, vector<T *> &out_vec)
{
  unsigned int ii;
  unsigned int num_elements = inp_vec.size();
  out_vec.resize(inp_vec.size());
  for(ii=0; ii != num_elements; ++ii) {
    T &t = *(inp_vec[ii]);
    out_vec[ii] = new T(t);
  }
}
#else
#define vector_ptrs_copy(inp_vec, out_vec, Type) \
{ \
  unsigned int ii; \
  unsigned int num_elements = inp_vec.size(); \
  out_vec.resize(inp_vec.size()); \
  for(ii=0; ii != num_elements; ++ii) {\
    vector<Type *> &ov_ptr = out_vec; \
    const vector<Type *> &iv_ptr = inp_vec; \
    Type &t = *(iv_ptr[ii]); \
    ov_ptr[ii] = new Type(t); \
  } \
}
#endif

#endif
